package com.ruoyi.project.men.api;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bootdo.R;
import com.ruoyi.project.men.service.MenSildeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * 门户图片
 */
@Controller
@RequestMapping("/api/menSilde")
public class ApiMenSildeController {
    @Autowired
    private MenSildeService menSildeService;

    /***
     *
     * @param `status` 0核心产品1解决方案2盾构大脑3活动列表4活动详情5联系我们
     *               linkId  关联的id
     * @return
     */
    @PostMapping( "/getMenSildeList")
    @ResponseBody
    public R getClassList(@RequestBody Map<String, Object> params){


        try{
            if (!params.containsKey("status") || StringUtils.isBlank(params.get("status").toString())
                    ||!params.containsKey("linkId")

            ) {
                return R.error("参数错误");
            }
            List<Map<String,Object>> list = menSildeService.getMenSildeList(params);
            return R.ok().put("data",list);
        }catch (Exception e){
            return R.error("服务器网络异常");
        }
    }
}
